package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UDataPolicyMapper;
import com.ruoyi.system.domain.UDataPolicy;
import com.ruoyi.system.service.IUDataPolicyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 政策台账Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-12
 */
@Service
public class UDataPolicyServiceImpl implements IUDataPolicyService 
{
    @Autowired
    private UDataPolicyMapper uDataPolicyMapper;

    /**
     * 查询政策台账
     * 
     * @param id 政策台账主键
     * @return 政策台账
     */
    @Override
    public UDataPolicy selectUDataPolicyById(Long id)
    {
        return uDataPolicyMapper.selectUDataPolicyById(id);
    }

    /**
     * 查询政策台账列表
     * 
     * @param uDataPolicy 政策台账
     * @return 政策台账
     */
    @Override
    public List<UDataPolicy> selectUDataPolicyList(UDataPolicy uDataPolicy)
    {
        return uDataPolicyMapper.selectUDataPolicyList(uDataPolicy);
    }

    /**
     * 新增政策台账
     * 
     * @param uDataPolicy 政策台账
     * @return 结果
     */
    @Override
    public int insertUDataPolicy(UDataPolicy uDataPolicy)
    {
        uDataPolicy.setCreateTime(DateUtils.getNowDate());
        return uDataPolicyMapper.insertUDataPolicy(uDataPolicy);
    }

    /**
     * 修改政策台账
     * 
     * @param uDataPolicy 政策台账
     * @return 结果
     */
    @Override
    public int updateUDataPolicy(UDataPolicy uDataPolicy)
    {
        uDataPolicy.setUpdateTime(DateUtils.getNowDate());
        return uDataPolicyMapper.updateUDataPolicy(uDataPolicy);
    }

    /**
     * 批量删除政策台账
     * 
     * @param ids 需要删除的政策台账主键
     * @return 结果
     */
    @Override
    public int deleteUDataPolicyByIds(String ids)
    {
        return uDataPolicyMapper.deleteUDataPolicyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除政策台账信息
     * 
     * @param id 政策台账主键
     * @return 结果
     */
    @Override
    public int deleteUDataPolicyById(Long id)
    {
        return uDataPolicyMapper.deleteUDataPolicyById(id);
    }


    @Override
    public int updateUDataPolicyFilePath(Long id, String filePath) {
        return uDataPolicyMapper.updateUDataPolicyFilePath(id, filePath);
    }
}
